<?php
//
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'main';
if($_RQ['op']=='main'){
	$return['post']=array('id'=>intval($_RQ['id']),'star'=>0);
	set_html('title','服务评分');
	exi($return);
}
if($_RQ['op']=='submit'){
	$postdata=get_postdata();
	$data=array(
		'comment'=>$postdata['comment'],
		'star'=>intval($postdata['star']),
	);
	$star=$this->pdo_getcolumn('order',array('id'=>intval($postdata['id'])),'star');
	if($star){
		exi('该评分已生效显示，不可修改！','error','goback');
	}else{
		$this->update('order',$data,array('id'=>$postdata['id'],'uniacid'=>$_SESSION['uniacid']));
	}
	exi('评分成功！','','/order/');
}
?>